import React from 'react';
import { View, Text } from '@tarojs/components';


import './pageHeader.scss';

/**
 * 页面头展示组件
 * @param {title} string - 组件标题
 * @returns {JSX.Element} 渲染的页面头组件
 */
export const PageHeader: React.FC<{title: string}> = ({ title }) => {
    if (!title) {
        return <></>;
    }

    return (
        <View className="cur-page-header">
            <View className="cur-page-header-content">
                <Text className="cur-page-title">{title}</Text>
                <View className="cur-page-car">
                    <View className="cur-page-strike"></View>
                    <View className="cur-page-strike cur-page-strike2"></View>
                    <View className="cur-page-strike cur-page-strike3"></View>
                    <View className="cur-page-strike cur-page-strike4"></View>
                    <View className="cur-page-strike cur-page-strike5"></View>
                    <View className="cur-page-car-detail cur-page-spoiler"></View>
                    <View className="cur-page-car-detail cur-page-back"></View>
                    <View className="cur-page-car-detail cur-page-center"></View>
                    <View className="cur-page-car-detail cur-page-center1"></View>
                    <View className="cur-page-car-detail cur-page-front"></View>
                    <View className="cur-page-car-detail cur-page-wheel"></View>
                    <View className="cur-page-car-detail cur-page-wheel cur-page-wheel2"></View>
                </View>
            </View>
        </View>
    );
};

export default PageHeader;
